import java.io.*;

public class ConvrsionStreamDemo {
    public static void main(String[] args) throws IOException {
        OutputStreamWriter ows = new OutputStreamWriter(new FileOutputStream("myCharStream\\osw.txt"),"GBK");
        ows.write("中国");
        ows.close();

        InputStreamReader isr = new InputStreamReader(new FileInputStream("myCharStream\\osw.txt"),"GBK");

        //一次读取一个字符数据
        int ch;
        while ((ch = isr.read())!=-1){
            System.out.print((char)ch);
        }

        isr.close();
    }
}
